var baseUrl="";
 var loginUrl=""; 
 $(function(){  
     $.get("../config/util.js", function(result){ 
	 var obj=JSON.parse(result);
	 baseUrl=obj.baseUrl;    
	 });
	 $.get("../config/login.js", function(result){ 
	 var obj=JSON.parse(result);
	 var u=obj.login; 
    loginUrl=baseUrl+u;
	var user={
		username:'',
		password:'',
		uFlag:true,
		pFlag:true
	}
	
	var app = new Vue({
          el: '#app',
		  data: {
			  user:user,
			 loginUrl:loginUrl
		  },
		  methods:{
		   login:function(){
			   var this_=this;
			   /*if(this_.user.username=='admin'&&this_.user.password=='admin123'){
				   window.location.href="http://localhost:8888/index?name="+this_.user.username;
			   }else{
				   
			   }*/
		      $.ajax({  
                type:'get',  
                url:loginUrl,
                data:{"name":this_.user.username,"password":this_.user.password},   
                success:function(data){  
                   if(data.state=='sucess'){
					    window.location.href="http://localhost:8888/index?name="+this_.user.username;
				   }
                }  
             });
		   },
		   check:function(){
			    console.log(11);
		   }
		   }
        });	 
	});	  		  
});